﻿using MubiSDK.DataConvertLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MubiSDK.CommunicationLib.Interface
{
    /// <summary>
    /// 读写接口
    /// </summary>
    public interface IReadWrite
    {
        /// <summary>
        /// 读取布尔数组
        /// </summary>
        /// <param name="address">设备地址</param>
        /// <param name="length">期望读取的布尔个数</param>
        /// <returns>返回操作结果，携带数据类型为bool[]</returns>
        OperateResult<bool[]> ReadBoolArray(string address, ushort length);

        /// <summary>
        /// 读取字节数组
        /// </summary>
        /// <param name="address">设备地址</param>
        /// <param name="length">期望读取的字节个数</param>
        /// <returns>返回操作结果，携带数据类型为byte[]</returns>
        OperateResult<byte[]> ReadByteArray(string address, ushort length);

        /// <summary>
        /// 写入布尔数组
        /// </summary>
        /// <param name="address">设备地址</param>
        /// <param name="value">待写入的布尔数组</param>
        /// <returns>返回操作结果</returns>
        OperateResult WriteBoolArray(string address, bool[] value);

        /// <summary>
        /// 写入字节数组
        /// </summary>
        /// <param name="address">设备地址</param>
        /// <param name="value">待写入的字节数组</param>
        /// <returns>返回操作结果</returns>
        OperateResult WriteByteArray(string address, byte[] value);
    }
}
